package samples.spring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Zi Lai Ye
 * @date 2017/4/7
 */
@Controller
@RequestMapping("")
public class HelloWorldController {

    @RequestMapping(value = "/hello", method = {RequestMethod.GET, RequestMethod.HEAD})
    public @ResponseBody String say() {
        System.out.println("=================");
        return "hello WORLD.";
    }

    @RequestMapping("/test")
    public @ResponseBody String test(){
        int a = 1, b=0;
        return String.valueOf(a/b);
    }
}
